package cn.lumora.controller.req;

import cn.lumora.core.validation.LoginGroup;
import cn.lumora.core.validation.PhoneLoginGroup;
import cn.lumora.core.validation.UsernameLoginGroup;
import lombok.Data;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;

@Data
public class LoginRequest {
    /**
     * 用户名
     */
    @NotEmpty(groups = {UsernameLoginGroup.class}, message = "用户名不能为空")
    private String username;

    /**
     * 密码
     */
    @NotEmpty(groups = {UsernameLoginGroup.class}, message = "密码不能为空")
    private String password;

    /**
     * 验证码
     */
    @NotEmpty(groups = {PhoneLoginGroup.class}, message = "验证码不能为空")
    private String captcha;

    /**
     * 手机号
     */
    @NotEmpty(groups = {PhoneLoginGroup.class}, message = "手机号不能为空")
    private String mobile;

    /**
     * 登录类型
     */
    @NotNull(message = "登录类型不能为空")
    private int loginType;

    /**
     * ip
     */
    private String ip;

    /**
     * 临时令牌
     */
    @NotEmpty(message = "临时令牌不能为空")
    private String tempToken;

}
